Skip to content

Refactor codechecker_server#188

Open
furtib wants to merge 3 commits intoEricsson:mainfrom
furtib:refactor-codechecker-server-testing
Open

Refactor codechecker_server#188
furtib wants to merge 3 commits intoEricsson:mainfrom
furtib:refactor-codechecker-server-testing

Conversation

@furtib
Copy link
Copy Markdown
Contributor

@furtib furtib commented Feb 4, 2026

Why:
The CodeChecker server might stay alive as a zombie process if interrupted.

What:

  • Created a CodeCheckerServer class
  • Replaced usage of CodeCheckerServer
  • Moved helper functions specific to the parse test into it

Addresses:
Fixes: #186
#152

@furtib furtib requested a review from Szelethus February 4, 2026 08:55
@furtib furtib self-assigned this Feb 4, 2026
@furtib furtib added the test ☑️ Adding or refactoring tests label Feb 4, 2026
@furtib furtib force-pushed the refactor-codechecker-server-testing branch from 0563010 to 32c6b45 Compare February 4, 2026 08:57
Copy link
Copy Markdown
Contributor

@Szelethus Szelethus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

self.start_codechecker_server()

def __del__(self):
self.stop_codechecker_server()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit I haven't spent terribly long with Python, but this might be the first time I've ever seen a destructor in the wild. My understanding is that, because of the garbage collector's unpredictability, this is not considered a Pythonic best practice. Even though your case is fine, as you call it explicitly, that kind of defeats the purpose of this function.

Then again, I'm not terribly opposed to it, because lingering zombie codechecker servers are quite annoying. Considering that we reuse the same server for all tests, this is likely fine.

@furtib furtib force-pushed the refactor-codechecker-server-testing branch from 32c6b45 to 939d260 Compare May 4, 2026 13:05
@furtib furtib force-pushed the refactor-codechecker-server-testing branch from 974f5d4 to 46e4852 Compare May 5, 2026 11:56
@furtib furtib requested a review from Szelethus May 5, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test ☑️ Adding or refactoring tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make CodeChecker server clean up after itslef even if interrupted

2 participants